package net.huashitong.buildedProject.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.buildedProject.dao.ProjectProgressDao;
import net.huashitong.buildedProject.dataBean.ProjectProgressDataBean;
import net.huashitong.buildedProject.entity.ProjectProgress;
import net.huashitong.buildedProject.filter.ProjectProgressFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectProgressService extends StringPKService<ProjectProgress> {
    @Autowired
    private ProjectProgressDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<ProjectProgress, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(ProjectProgress obj) {
        obj.setSysId(tableService.updateMaxSysId("t_bnp_project_progress", null));
    }

    public List<ProjectProgressDataBean> queryProjectProgressDataBean(ProjectProgressFilter filter){
        return dao.queryProjectProgressDataBean(filter);
    }

}
